const fs = require('fs')
const path = require('path')

console.log('fs:', fs)
console.log('path:', path)

const modifiedData = {
  name: 'alice',
  age: 25,
  email: 'alice@example.com'
}

const updateData = () => {
  fs.writeField('./factors.json', JSON.stringify(modifiedData), (err) => {
    if (err) {
      console.error(err)
      return
    }
    console.log('data saved successfully')
  })
}

export { updateData }
